#!/usr/bin/python
# -*- coding: utf-8 -*-

import itchat
import requests
import re
import top


@itchat.msg_register(itchat.content.TEXT)
def print_content(msg):
    print(msg['Text'])
    tkl = re.search(r'￥(.*)￥',msg['Text']).group()
    print(tkl)
    url = 'http://api.w4.org.cn/api/detkl.php?tkl='+'uuJX0IfwXmK'

    good = requests.get(url)
    good.encoding = "utf-8"
    print(good.content)
    print('============')
    print(good.text)
    return tkl



itchat.auto_login(hotReload=True)
itchat.run()



